import axios from '../axios/index'

export const _post = (url, obj) => {
  return new Promise((resolve, reject) => {
    Object.freeze(obj)
    axios.post(url, obj)
      .then(res => {
        resolve(res.data)
      })
      .catch(err => {
        reject(err)
      })
  })
}

export const _get = (url, obj) => {
  return new Promise((resolve, reject) => {
    Object.freeze(obj)
    axios.get(url)
      .then(res => {
        resolve(res.data)
      })
      .catch(err => {
        reject(err)
      })
  })
}